﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Nantianmen.Core.Services;
using Nantianmen.Core.Stores;
using Nantianmen.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nantianmen
{
    public class AspNetRouteService : RouteService
    {
        private CancellationToken _cancel;

        public AspNetRouteService(ILogger<RouteService> logger, IRouteStore store, NantianmenErrorDescriber errorDescriber, IServiceProvider services) : base(logger, store, errorDescriber)
        {
            _cancel = services.GetRequiredService<IHttpContextAccessor>().HttpContext?.RequestAborted ?? CancellationToken.None;
        }
    }
}
